<%@page contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>tree示例</title>
		<cw:base />
	</head>
	<body>
		<ul>
			<li>
				<table>
					<tr valign="top">
						<td width="300">
							<cw:tree id="tree"
								url="${pageContext.request.contextPath }/sample/tree/query.action" height="220"
								formLoadAction="${pageContext.request.contextPath }/sample/tree/loadTreeForm.action"
								editable="true"
								formDeleteAction="${pageContext.request.contextPath }/sample/tree/delTreeFrom.action"
								formAddAction="${pageContext.request.contextPath }/sample/tree/saveTreeForm.action"
								formUpdateAction="${pageContext.request.contextPath }/sample/tree/saveTreeForm.action" />
						</td>
						<td>
							<cw:form ajax="true" id="form" method="post">
								<table>
									<tr>
										<td>
											节点内容：
										</td>
										<td>
											<cw:text property="text" />
										</td>
									</tr>
									<tr>
										<td>
											节点ID：
										</td>
										<td>
											<cw:text property="id" readOnly="true" />
											<cw:text property="parentId" type="hidden" />
										</td>
									</tr>
								</table>
							</cw:form>
						</td>
					</tr>
				</table>
			</li>
		</ul>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/treefix.js"></script>
		<script type="text/javascript">
			Ext.onReady(function(){
				resetHeight("editTreeFrame");
			})
		
			function resetHeight(frame) {
				var ifm = parent.document.getElementById(frame);
				var obj = document.body;
				var oStyle = obj.currentStyle? obj.currentStyle : window.getComputedStyle(obj, false);
				var initHeight = parseInt(document.body.clientHeight+parseInt(oStyle["margin-top"])+parseInt(oStyle["margin-bottom"]));
				ifm.height = parseInt(initHeight);
			}
		</script>
	</body>
</html>
